﻿using MusicExplorer.Common;
using MusicExplorer.ViewModel;
using MusicExplorer.ViewModel.Wrappers;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading.Tasks;
using System.Windows.Input;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The Items Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234233

namespace MusicExplorer.View
{
    /// <summary>
    /// A page that displays a collection of item previews.  In the Split App this page
    /// is used to display and select one of the available groups.
    /// </summary>
    public sealed partial class HomePageView : Page
    {
        public HomePageView()
        {
            InitializeComponent();
            Loaded += HomePageView_Loaded;
        }

        async void HomePageView_Loaded(object sender, RoutedEventArgs e)
        {
            DataContext = await HomePageViewModel.CreateAsync<HomePageViewModel>(null);
        }

        //private void OnRepositoryClick(object sender, ItemClickEventArgs e)
        //{
        //    var entity = ((RepositoryWrapper)e.ClickedItem).Entity;
        //    var parent = (ViewModelBase)DataContext;
        //    this.Frame.Navigate(typeof(RepositoryPageView), new NavigationObject(parent, entity));
        //}
    }
}
